<template>
  <router-view />
</template>

<script>
export default {
  data() {
    return {}
  },
  created() {
    this.isMobile()
  },
  methods: {
    isMobile() {
      let flag = navigator.userAgent.match(
        /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
      )
      if (flag) {
        if (this.$route.path === '/foundation/'||this.$route.path === '/foundation') {
          this.$router.push({
            path: '/foundation/wap',
            query: this.$route.query
          })
        }
      } else {
        if (this.$route.path === '/foundation/'||this.$route.path === '/foundation') {
          this.$router.push({
            path: '/foundation/pc',
            query: this.$route.query
          })
        }
      }
    }
  }
}
</script>